package com.youhong.teethcare.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.youhong.teethcare.R;

import java.util.List;

/**
 * Created by Administrator on 2018/5/7 0007.
 */

public class SpinnerAdapter extends ArrayAdapter {


    public SpinnerAdapter(@NonNull Context context, int resource, @NonNull Object[] objects) {
        super(context, resource, objects);
    }

    /*

    public SpinnerAdapter(@NonNull Context context, int resource, @NonNull List objects) {
        super(context, resource, objects);
    }
*/

    @NonNull
    @Override
    public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
        View v = View.inflate(getContext(), R.layout.sp_item, null);
        ((TextView) v.findViewById(R.id.sp_item_tv)).setText(getItem(position).toString());
        return v;
    }

    @Override
    public int getCount() {
        return super.getCount();
    }
}
